layui.use(['table'], function () {
    var table = layui.table;

    /**
     * 集团综合信息--集团短信白名单
     */
    var BlocWhiteList = {
        tableId: "whiteListTable",    //表格id
        condition: {
            msisdn: ""
        }
    };

    /**
     * 初始化表格的列
     */
    BlocWhiteList.initColumn = function () {
        return [[
            {field: 'number', align: "center", title: '序号',type:'numbers'},
            {field: 'msisdn', align: "center", title: 'MSISDN'}
        ]];
    };

    // 渲染表格
    table.render({
        elem: '#' + BlocWhiteList.tableId,
        url: Feng.ctxPath + '/blocSyn/blocWhiteLists?accountId='+$("#accountId").val(),
        page: {
            prev: "上一页",
            next: "下一页",
            layout: ['prev', 'next'],
            limit: 50
        },
        height: "full-98",
        cellMinWidth: 100,
        cols: BlocWhiteList.initColumn()
    });

    $("#btnSearch").click(function () {
        BlocWhiteList.search();
    });

    /**
     * 点击查询按钮
     */
    BlocWhiteList.search = function () {
        var queryData = {};
        queryData['msisdn'] = $("#msisdn").val();
        table.reload(BlocWhiteList.tableId, {
            where: queryData
        });
    };
});